export namespace="vela-system"
export app_name="kubevela"
export repo="kubevela"
export helm="$repo/vela-core"
# export url="https://charts.kubevela.net/core"
export url="https://kubevela.github.io/charts/"

# curl -fsSl https://kubevela.io/script/install.sh | bash
# vela install -v $version
# curl -fsSl https://kubevela.net/script/install.sh | bash -s

helm repo remove $repo
helm repo add $repo $url
helm repo update $repo

helm upgrade --create-namespace --install -n $namespace $app_name $helm --wait

# --set image.repository="acr.kubevela.net/oamdev/vela-core" --wait

export acr="acr.kubevela.net"   # repo=acr.kubevela.net
export domain="vela.youling.io" #vela.lntu.edu.cn
export gateway="higress"
vela addon enable velaux domain=${domain} #gatewayDriver=${gateway} # repo=${acr} #
vela addon enable vela-workflow
# vela addon enable vela-prism repo=acr.kubevela.net

# kubectl apply -f vela.youling.io.yaml

# =========== 卸载 ==================
# 卸载 VelaUX
# vela addon disable velaux
# kubectl delete configmap --all -n kubevela
# 卸载 KubeVela Core
#  helm uninstall -n vela-system kubevela
# 卸载 KubeVela 安装的 CRD
#  kubectl get crd |grep oam | awk '{print $1}' | xargs kubectl delete crd

# vela logs -n vela-system --name apiserver addon-velaux | grep "initialized admin username" admin / VelaUX12345"

# curl -fsSl https://static.kubevela.net/script/install-velad.sh | bash
# velad install
# velad uninstall
